package projet_v1;

import java.util.List;

import projet_v1.simulation.Field;
import projet_v1.simulation.Location;

/**
 * MadZombie class, derives from Zombie. A MadZombie has more power than a
 * Zombie.
 * 
 * @author Antoine Lavail
 * 
 */
public class MadZombie extends Zombie implements Actor {

    // Defaults HP
    public static final int HP_MADZOMBIES = 50;

    /**
     * Constructor of MadZombie.
     * 
     * @param healthPoints
     *            : the attributed health points.
     */
    public MadZombie(int healthPoints) {
        super(healthPoints, Breed.MADZOMBIE);
    }

    /**
     * Second constructor of MadZombie. Locate the MadZombie on the map.
     * 
     * @param healthPoints
     *            : the attributed health points.
     * @param f
     *            : The current field.
     * @param l
     *            : The location on the field.
     */
    public MadZombie(int healthPoints, Field f, Location l) {
        super(healthPoints, Breed.MADZOMBIE, f, l);
    }

    /**
     * Actions when a MadZombie encounter somebody.
     */
    protected void attack(Character c) {
        c.reduceHealthPoints(25);
    }

    /**
     * Make this character act ­ that is: make it do whatever it wants/needs to
     * do.
     * 
     * @param currentField
     *            The field currently occupied.
     * @param updatedField
     *            The field to transfer to.
     * @param newActors
     *            A list to add newly born character to.
     */
    public void act(Field currentField, Field updatedField,
            List<Actor> newActors) {
        if (isAlive()) {
            Location newLocation = updatedField
                    .freeAdjacentLocation(getLocation(), 1);
            if (newLocation != null) {
                setLocation(newLocation);
                updatedField.place(this, newLocation);
            }
        }
    }

}